package com.siwei.mes.entity.experiment.concrete.quick;

import com.alibaba.fastjson.JSONObject;
import com.siwei.mes.common.util.JsonUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @Description: 和易性
 * @Version: 1.0
 * @author: chenmaolin
 * @date: 2023/12/27 22:25
 */
@Data
@Accessors(chain = true)
public class ConcreteHyx {
    @ApiModelProperty(value = "非常差  1-选中")
    private String fcc = "0";

    @ApiModelProperty(value = "一般 1-选中")
    private String yb = "0";

    @ApiModelProperty(value = "很好 1-选中")
    private String hh = "0";

    /**
     * 字符串转成对象 然后再转成json
     *
     * @param object
     * @return
     */
    private static JSONObject toJsonObject(Object object) {
        ConcreteHyx entity = new ConcreteHyx();
        if (object == null) {
            return JsonUtils.beanToObject(entity);
        }
        if (object instanceof String) {
            entity = JsonUtils.getObject((String) object, ConcreteHyx.class);
        } else if (object instanceof JSONObject) {
            entity = JsonUtils.getObject((JSONObject) object, ConcreteHyx.class);
        }
        return JsonUtils.beanToObject(entity);
    }
}
